package com.yanboo.modules.mnt.domain;

import com.yanboo.common.base.BaseEntity;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import jakarta.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;


@Entity
@Getter
@Setter
@Table(name="mnt_deploy_history")
public class DeployHistory extends BaseEntity implements Serializable {

    @Schema(description = "应用名称")
    private String appName;

	@Schema(description = "IP")
    private String ip;

	@CreationTimestamp
	@Schema(description = "部署时间")
    private Timestamp deployDate;

	@Schema(description = "部署者")
    @Column(length = 50)
    private String deployUser;

	@Schema(description = "部署ID")
    @Column(length = 20)
	private Long deployId;

    public void copy(DeployHistory source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
